<template>
    <div class="sideMenu">
        <div v-for="(item,index) in $store.state.menuList" :key="index">
            <menu-item :item="item"></menu-item>
        </div>
    </div>
</template>

<script>
    import arrowDown from '@img/icon-arrow-down.png';
    import arrowUp from '@img/icon-arrow-up.png';
    import routers from '../../../router/routers'
    import SideMenuItem from "./SideMenuItem";
    import MenuItem from "./MenuItem";

    export default {
        name: "sideMenu",
        components: {MenuItem, SideMenuItem},
        data() {
            return {
                arrow: true,
                arrowDown: arrowDown,
                arrowUp: arrowUp,
            }
        },
        created() {
            const menuList=JSON.parse(sessionStorage.getItem('menuList'));
            if(menuList){
                this.$store.state.menuList=menuList
            }else {
                this.$store.state.menuList=routers;
            }
        },
        methods: {
        }
    }
</script>

<style scoped>
    .sideMenu {
        text-align: left;
        padding: 0 15px 15px 15px;
    }
</style>